package com.xnyzc.lhy.resource.entity.invoice;

import com.xnyzc.lhy.common.penum.invoice.EInvoiceErrorCode;
import lombok.Data;

import java.io.Serializable;

@Data
public class InvoiceFormatFileResult implements Serializable {
    private static final long serialVersionUID = -1580620424837593435L;

    private Boolean isSuccess;

    private InvoiceErrorResponse invoiceErrorResponse;

    private FormatFileSuccessResponse formatFileSuccessResponse;

    /**
     * 创建服务调用错误信息
     * @param eInvoiceErrorCode
     * @return
     */
    public static InvoiceFormatFileResult getInvoiceErrorResponse(EInvoiceErrorCode eInvoiceErrorCode){
        InvoiceFormatFileResult invoiceResult = new InvoiceFormatFileResult();
        invoiceResult.setIsSuccess(false);
        InvoiceErrorResponse invoiceErrorResponse = new InvoiceErrorResponse(
                eInvoiceErrorCode.getValue().toString(),
                eInvoiceErrorCode.getDesc());
        invoiceResult.setInvoiceErrorResponse(invoiceErrorResponse);

        return invoiceResult;
    }
}
